<template>
  <el-dialog
    title="用户详情"
    :visible.sync="dialogVisible"
    :before-close="closeDialog"
    width="60%"
    class=""
    :close-on-click-modal="false"
    :append-to-body="true"
  >
    <!-- <div class="title-gra plr30">
      <div class="grab gra-r">
        <span class="grab gra-l"></span>
      </div>
    </div> -->
    <div>
      <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
        <el-form-item label="用户Id：">
          {{ ruleForm.account }}
        </el-form-item>
        <el-form-item label="身份证号：">
          {{ ruleForm.idCardNumber }}
        </el-form-item>
        <el-form-item :label="staffNo">
          {{ ruleForm.policeId }}
        </el-form-item>
        <el-form-item label="真实姓名：">
          {{ ruleForm.userName }}
        </el-form-item>
        <el-form-item label="单位名称：">
          {{ ruleForm.companyName }}
        </el-form-item>
        <el-form-item label="是否锁定：">
          <template>
            <span v-if="ruleForm.lockFlag==0">正常</span>
            <span v-if="ruleForm.lockFlag==1">锁定</span>
          </template>
        </el-form-item>
      </el-form>
      <div class="mr-btn">
        <el-button class="golable-sty-btn" type="primary" @click="closeDialog">确定</el-button>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import { getUserDetail } from "@/api/userApi.js";
export default {
  data() {
    return {
      dialogVisible: false,
      roleId: "",
      ruleForm: { },
      staffNo: window.pageData.USER_MANAGEMENT.staffNo
    };
  },
  methods: {
    openDialogVisible(val) {
      this.dialogVisible = true;
      this.userId = val.id;
      console.log(this.roleId);
      this.getUserDetail();
    },
    getUserDetail() {
      getUserDetail(this.userId).then(res => {
        if (res.data.success) {
          this.ruleForm = res.data.data;
        }
      });
    },
    closeDialog() {
      this.$emit("callBack");
      this.dialogVisible = false;
    }
  }
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
element.style {
    width: 200px;
    
}
.el-form-item--medium .el-form-item__content{
  margin-left: 100px !important;
}
</style>

